import request from "../utils/request";

//抖音登录
export const douYinLoginApi = (code) => {
  return request({
    url: `/api/douyin/douyin_cartoon_login`,
    method:'POST',
    data:{
      code
    }
  });
}

// 微信登录
export const weiXinLoginApi = (code , appid) => (request({url:`/api/weixin/wx_login?code=${code}&appid=${appid}`}))


// 创建动漫任务  
export const createCartoonApi = (data) => {
  return request({
    url:`/api/demo/create_cartoon_task`,
    method:'POST',
    data
  });
}

// 获取结果图片列表  
export const getResultListApi = (id) => (request({url:`/api/demo/get_result_img_list?user_id=${id}`} , false))


// 获取任务结果   旧接口
export const getResultByTaskIdApi = (id) => (request({url:`/api/demo/get_result_by_task_id?task_id=${id}`} , false))


// 获取任务结果 新接口 
export const getWaitListApi = id => {
  return request({
    url:'/api/demo/get_wait_list',
    method:'POST',
    data:{
      user_id:id
    }
  },false)
}


// 保存图片 
export const saveUserImgApi = (data) => {
  return request({
    url:'/api/demo/save_user_img',
    method:'POST',
    data
  })
}

// 删除图片
export const delUserImgApi = id => {
  return request({
    url:'/api/demo/del_user_img',
    method:'POST',
    data:{
      img_id:id
    }
  })
}